package com.gustuy;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Properties;

public class PropertiseServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        Properties properties=new Properties();
        properties.load(this.getServletContext().getResourceAsStream("/WEB-INF/classes/db.properties"));
        resp.getWriter().print("name:"+properties.getProperty("username"));
    }
}
